<?

if ($DATA['component']['id']) {

	// list editor
	
	$_id_component	= $DATA['component']['id'];			//	list id value
	$_id_data		= D_MB_DATA;			//	meta id value
	$_id_meta		= D_MB_META;			//	meta id value


	// get current date
	$DATA['today'] = parse_today();
	
	if (!($dt = param('date')) || !($dt = parse_date($dt)) ) 		// get date from param (y2k-YY-MM-DD) if correct, elsewere get current date
		$dt = $DATA['today'];
	
	$DATA['date'] = $dt;

	$_crit = "id_data=$_id_data AND id_parent=$_id_component";

	$DATA['objects'] = datafetch_array('db_list', array(
		'table' => tb('data'), 
		'where' => "$_crit", 
		'select' => "*, DATE(date) as day",
		'index' => 'day' ));
	
	$DATA['days'] = array();
	
	foreach ($DATA['objects'] as $date) {
		list($y, $m, $d) = explode('-', $date['day']);
		if (!isset($DATA['days'][$y])) $DATA['days'][$y] = array();
		if (!isset($DATA['days'][$y][$m])) $DATA['days'][$y][$m] = array();
		$DATA['days'][$y][$m][$d] = true;
	}
		


	return false;
} else exit;

?>